package multithreaded;

import java.util.concurrent.locks.ReentrantLock;

public class ThreadTest2 {
    public static void main(String[] args) {
        // 匿名内部类  实现Runnable接口
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println(Thread.currentThread().getName() + ": run...");
                }
            }
        }, "T1").start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println(Thread.currentThread().getName() + ": run...");
                }
            }
        }, "T2").start();
    }
}
